/** 
 * 2011-10-11 上午11:23:10 
 * UdpMessageContext.java 
 * author:sunb 
 */
package com.u6.udp.netty;

import java.net.SocketAddress;


/**
 * @author sunbin
 * 
 */
public class UdpMessageContext {
	private static final ThreadLocal<UdpMessageContext> actionContextThreadLocal = new ThreadLocal<UdpMessageContext>();
	private UdpMessage actionMessage;

	private UdpMessageContext(UdpMessage actionMessage) {
		this.actionMessage = actionMessage;
	}

	public static UdpMessageContext getInstance() {
		return (UdpMessageContext) actionContextThreadLocal.get();
	}

	public static void newInstance(UdpMessage actionMessage) {
		UdpMessageContext context = new UdpMessageContext(actionMessage);
		actionContextThreadLocal.set(context);
	}

	public UdpMessage getActionMessage() {
		return this.actionMessage;
	}
}
